<html>
<head><meta charset="utf-8"><title>SimdU128 · project-portable-simd · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/index.html">project-portable-simd</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html">SimdU128</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="236098029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236098029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236098029">(Apr 25 2021 at 22:18)</a>:</h4>
<p>So, like... I'm not <em>opposed</em> to adding them per se, but I just kinda wanna know... is anyone actually gonna use 'em?</p>



<a name="236100210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100210">(Apr 25 2021 at 22:58)</a>:</h4>
<p>I should also note, <span class="user-mention" data-user-id="312331">@Caleb Zulawski</span>, that part of my trepidation is because there's already several special casings in the Rust compiler test framework for 128-bit integers, because of things like <a href="https://github.com/rust-lang/unsafe-code-guidelines/issues/119">https://github.com/rust-lang/unsafe-code-guidelines/issues/119</a></p>



<a name="236100219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100219">(Apr 25 2021 at 22:58)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/54341">https://github.com/rust-lang/rust/issues/54341</a> <span aria-label="grimacing" class="emoji emoji-1f62c" role="img" title="grimacing">:grimacing:</span></p>



<a name="236100354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100354">(Apr 25 2021 at 23:00)</a>:</h4>
<p>Well that's not good lol</p>



<a name="236100413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100413">(Apr 25 2021 at 23:01)</a>:</h4>
<p>I suppose there is no AtomicU128 right? So it wouldn't be shocking to not have it at least for now</p>



<a name="236100533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100533">(Apr 25 2021 at 23:03)</a>:</h4>
<blockquote>
<p>AtomicBool    <br>
AtomicI8    <br>
AtomicI16   <br>
AtomicI32   <br>
AtomicI64   <br>
AtomicIsize <br>
AtomicPtr   <br>
AtomicU8    <br>
AtomicU16   <br>
AtomicU32   <br>
AtomicU64   <br>
AtomicUsize</p>
</blockquote>



<a name="236100693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100693">(Apr 25 2021 at 23:05)</a>:</h4>
<p>apparently it's based on the system atomic width!</p>



<a name="236100749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100749">(Apr 25 2021 at 23:06)</a>:</h4>
<p>this is usually 64-bit, except Apple mandates 128-bit. Interesting.</p>



<a name="236100757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100757">(Apr 25 2021 at 23:06)</a>:</h4>
<p>Interesting, usually it's just the pointer width</p>



<a name="236100778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100778">(Apr 25 2021 at 23:07)</a>:</h4>
<p>How do they even do that?? They still use x86-64</p>



<a name="236100789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100789">(Apr 25 2021 at 23:07)</a>:</h4>
<p>Unless you mean for arm64e</p>



<a name="236100828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100828">(Apr 25 2021 at 23:08)</a>:</h4>
<p>Apple just requires it and doesn't work on x86_64 machines that don't have Atomic U128s.</p>



<a name="236100880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100880">(Apr 25 2021 at 23:09)</a>:</h4>
<p>Like I said, I think we should come back to this, but I also think we should like... come back when we have a <strong>plan</strong>.</p>



<a name="236100971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100971">(Apr 25 2021 at 23:10)</a>:</h4>
<p>Yeah, we can just remove them if you want</p>



<a name="236100973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236100973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236100973">(Apr 25 2021 at 23:10)</a>:</h4>
<p>It's unfortunate that LLVM doesn't do anything even remotely clever</p>



<a name="236103019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236103019">(Apr 25 2021 at 23:46)</a>:</h4>
<p>iirc x86_64, aarch64, and ppc64 all support 128-bit cmpxchg at the hw level (with appropriate isa extensions), so AtomicU128 <em>should</em> be supported on them.</p>



<a name="236103279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236103279">(Apr 25 2021 at 23:50)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229517">Jacob Lifshay</span> <a href="#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103019">said</a>:</p>
<blockquote>
<p>iirc x86_64, aarch64, and ppc64 all support 128-bit cmpxchg at the hw level (with appropriate isa extensions), so AtomicU128 <em>should</em> be supported on them.</p>
</blockquote>
<p>It turns out: "No, actually."<br>
x86_64's earliest implementations, back when it was mostly known as amd64, did not support cmpxchg16b.<br>
aarch64 <em>does</em> support AtomicU128.</p>



<a name="236103323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236103323">(Apr 25 2021 at 23:51)</a>:</h4>
<p>This means that the Windows and Linux targets, which define themselves as supporting the lowest common denominator of x86_64, don't have AtomicU128 <strong>by default</strong>.</p>



<a name="236103348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236103348">(Apr 25 2021 at 23:51)</a>:</h4>
<p>Oh right, apple mandates more than SSE2</p>



<a name="236103394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236103394">(Apr 25 2021 at 23:52)</a>:</h4>
<p>Now it all makes sense</p>



<a name="236103520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236103520">(Apr 25 2021 at 23:54)</a>:</h4>
<p>aarch64 at least has atomic128 load/store via stlxp and ldaxp. i don't know if it has ll/sc or a cas, though. i think i've heard it does</p>



<a name="236103568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236103568">(Apr 25 2021 at 23:55)</a>:</h4>
<p>i think apple might mandate more than ssse3 in practice, since we require macos 10.7+. never bothered to look which hardware that actually supports</p>



<a name="236103696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236103696">(Apr 25 2021 at 23:58)</a>:</h4>
<p>Anyways, I made sure to make it one nice commit to revert later. :^)</p>



<a name="236103748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236103748">(Apr 25 2021 at 23:58)</a>:</h4>
<p><a href="https://github.com/rust-lang/stdsimd/pull/100/commits/92d643b6283b0171873de4c46f708005af025f33">https://github.com/rust-lang/stdsimd/pull/100/commits/92d643b6283b0171873de4c46f708005af025f33</a></p>



<a name="236106059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236106059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236106059">(Apr 26 2021 at 00:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281757">Jubilee</span> <a href="#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103279">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="229517">Jacob Lifshay</span> <a href="#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236103019">said</a>:</p>
<blockquote>
<p>iirc x86_64, aarch64, and ppc64 all support 128-bit cmpxchg at the hw level (with appropriate isa extensions), so AtomicU128 <em>should</em> be supported on them.</p>
</blockquote>
<p>It turns out: "No, actually."<br>
x86_64's earliest implementations, back when it was mostly known as amd64, did not support cmpxchg16b.<br>
aarch64 <em>does</em> support AtomicU128.</p>
</blockquote>
<p>you missed that I said "with appropriate isa extensions" -- so that means cmpxchg16b on x86_64</p>



<a name="236106350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236106350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236106350">(Apr 26 2021 at 00:46)</a>:</h4>
<p>Blah, okay yes. sorry.</p>



<a name="236106595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/SimdU128/near/236106595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/SimdU128.html#236106595">(Apr 26 2021 at 00:50)</a>:</h4>
<p>That would require building std yourself</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>